package com.lx.patterns.interpreter;

/**
 * @ClassName Value
 * @Description: 变量类--终结表达式
 * @Author: 落雪
 * @CreateDate: 2025/2/15 16:17
 * @UpdateUser: 落雪
 * @UpdateDate: 2025/2/15 16:17
 * @UpdateRemark:
 * @Version: 1.0
 */
public class Value implements AbstractExpression {

    private int value;

    public Value(int value) {
        this.value = value;
    }

    @Override
    public int interpret(Context context) {
        return value;
    }

    @Override
    public String toString() {
        return new Integer(value).toString();
    }
}
